package br.com.site.fiolaser.util;

import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;
import javax.faces.convert.ConverterException;

public class BooleanToStringSN implements Converter{

	public Object getAsObject(FacesContext arg0, UIComponent arg1, String arg2) throws ConverterException {
		
		System.out.println(arg2);
		
		return arg2.toString();
	}

	public String getAsString(FacesContext arg0, UIComponent arg1, Object arg2) throws ConverterException {
		
		Boolean bol = (Boolean) arg2;
		
		if(bol.booleanValue()){
		
			return "S";
			
		}else{
			
			return "N";
			
		}
		
	}

}
